package com.exampler.controller;

import com.exampler.service.SentinelService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/sentinel")
public class Sentinel1Controller {
    private Logger logger = LoggerFactory.getLogger(Sentinel1Controller.class);

    @Autowired
    private SentinelService service;

    @RequestMapping("/test")
    public String test(long id) {
        logger.info(id + "");

        return service.test(id);
    }

    @RequestMapping("/test2")
    public String test2(long id) {
        logger.info(id + "");
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return "test2";
    }
}
